package com.yuyou.train.lesson.service;

import java.util.List;

import org.springframework.web.bind.annotation.RequestParam;

import com.yuyou.train.lesson.vo.req.ReqLessonUpdate;
import com.yuyou.train.service.api.lesson.dto.LessonDetailDTO;
import com.yuyou.train.service.api.lesson.dto.LessonTreeDTO;
import com.yuyou.train.service.api.lesson.entity.Lesson;
import com.yuyou.train.util.bean.ResBoolSimpleInfo;

public interface ILessonService {
    int deleteByPrimaryKey(String id);

    int insert(Lesson record);

    Lesson selectByPrimaryKey(String id);
    
    List<Lesson> findByClassId(String classId);
    
    List<Lesson> findByParentId(String classId);

    List<Lesson> findLessons(Lesson lesson,List<String> noContainIds);
    
    int updateByPrimaryKeySelective(Lesson record);
     
    ResBoolSimpleInfo<Lesson> updateLesson(ReqLessonUpdate reqLessonUpdate);
    
    ResBoolSimpleInfo<Lesson> addLesson(String id,String name)throws Exception ;
    
    ResBoolSimpleInfo<Lesson> updateLessonName(String id,String name) ;
    
    LessonDetailDTO detailLesson(String id);
    
    /**
     * 删除课程，关联资源规则不能删除
     * @param id
     * @return
     */
    ResBoolSimpleInfo<String> delLesson(String id) throws Exception;
    
    Long getNextLessonSort(String classId,String parentId,int level) throws Exception;
    
    List<LessonTreeDTO> lessonTree(String classId);
    
    /**
     * 课程是否正在使用
     * @param lessonId
     * @return
     */
    ResBoolSimpleInfo<String> isLessonUse(String lessonId);
    
    List<Lesson> findSubjectLesson(String lessonClassId,String subjectId);
    
    List<Lesson> findLessLesson(String lessonClassId,String subjectId,Long sort);

	ResBoolSimpleInfo<Lesson> updateLessonAndRel(ReqLessonUpdate reqLessonUpdate);
    
    

}